package com.system.connect.springboot_flowers.service.impl;

import com.system.connect.springboot_flowers.entity.FlowerDetail;
import com.system.connect.springboot_flowers.mapper.FlowerDetailMapper;
import com.system.connect.springboot_flowers.service.FlowerDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FlowerDetailServiceImpl implements FlowerDetailService {
    @Autowired
    private FlowerDetailMapper flowerDetailMapper;

    @Override
    public FlowerDetail getById(Long id) {
        return flowerDetailMapper.selectById(id);
    }

    @Override
    public List<FlowerDetail> getAll() {
        return flowerDetailMapper.selectAll();
    }

    @Override
    public void save(FlowerDetail flowerDetail) {
        flowerDetailMapper.insert(flowerDetail);
    }

    @Override
    public void update(FlowerDetail flowerDetail) {
        flowerDetailMapper.updateById(flowerDetail);
    }

    @Override
    public void delete(Long id) {
        flowerDetailMapper.deleteById(id);
    }
}
